<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <form ng-app="myApp" ng-controller="myCtrl" name="myForm" novalidate>
        <p>用户名：
            <br>
            <input type="text" name="user" ng-model="user" required>
            <span style="color:red" ng-show="myForm.user.$dirty && myForm.user.$invalid">
                <span ng-show="myForm.user.$error.required">请输入用户名</span>
            </span>
        </p>
        <p>邮箱：
            <br>
            <input type="email" name="email" ng-model="email" required>
            <span style="color:red" ng-show="myForm.email.$dirty && myForm.email.$invalid">
                <span ng-show="myForm.email.$error.required">请输入邮箱</span>
            <span ng-show="myForm.email.$error.email">非法的邮箱</span>
            </span>
        </p>
        <p>
            <input type="submit" ng-disabled="myForm.user.$dirty && myForm.user.$invalid ||
            myForm.email.$dirty && myForm.email.$invalid">
        </p>
    </form>
    <script src="../js/angular165/angular.min.js"></script>
    <script>
        var app = angular.module('myApp', []);
        app.controller('myCtrl', function($scope) {
            $scope.user = 'kl';
            $scope.email = 'ren@qq.com';
        });
    </script>
</body>

</html>